﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class maxSeqOfEqElements
{
    static void Main()
    {               //0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
        int[] Arr = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6 };
        int maxLen = 0;
        int bestStart = 0;
        for (int element = 0; element < (Arr.Length - 1); element++)
        {
            int len = 0;
            if (Arr[element] == Arr[element + 1])
            {
                for (int counter = element; counter < (Arr.Length - 1); counter++)
                {
                    if (Arr[counter] != Arr[counter + 1])
                    {
                        break;
                    }
                    len++;
                }
            }
            if (len > maxLen)
            {
                maxLen = len;
                bestStart = element;
            }
        }
        for (int counter2 = bestStart; counter2 <= (bestStart + maxLen); counter2++)
        {
            Console.WriteLine("[{0}] {1}", counter2, Arr[counter2]);
        }
    }
}

